//
//  SSModifyPsdViewController.m
//  starspaceVR
//
//  Created by 曹端芹 on 17/10/11.
//  Copyright © 2017年 starspace. All rights reserved.
//

#import "SSModifyPsdViewController.h"
#import "SSUserInfoModel.h"
#import "SSUserInfoManager.h"

@interface SSModifyPsdViewController ()
@property (weak, nonatomic) IBOutlet UILabel *userNameL;
@property (weak, nonatomic) IBOutlet UITextField *oldpsdTF;

@property (weak, nonatomic) IBOutlet UITextField *newpsdTF;
@property (weak, nonatomic) IBOutlet UITextField *againpsdTF;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *confirmBtnHeight;

@end

@implementation SSModifyPsdViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.navigationItem.title = @"修改密码";
    self.confirmBtnHeight.constant = kRealValue(45);
    SSUserInfoModel *userInfo = [[SSUserInfoManager sharedManager] currentUserInfo];
    self.userNameL.text = userInfo.loginName;
    
}



- (IBAction)confirmClick:(UIButton *)sender {
    [self.view endEditing:YES];
    if (self.oldpsdTF.text.length == 0) {
        [self showTip:@"请输入您的旧密码"];
        return;
    }
    if (self.newpsdTF.text.length == 0) {
        [self showTip:@"请输入您的新密码"];
        return;
    }
    if (self.againpsdTF.text.length == 0) {
        [self showTip:@"请再次确认您的新密码"];
        return;
    }
    if (![self.newpsdTF.text isEqualToString:self.againpsdTF.text]) {
        [self showTip:@"密码前后输入不一致"];
        return;
    }
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
